
const json2tsv = require('./src/json2tsv').default;
const tsv2json = require('./src/tsv2json.js').default;
const addFromTsv = require('./src/addFromTsv').default;

async function main() {
  const commandArgs = process.argv.slice(3);
  const taskName = process.argv[2];
  /**
   * yarn run task:tojson *.tsv *.tsv *.tsv ...
   */
  if (taskName === '-tojson') {
    tsv2json(commandArgs);
  }
  /**
   * yarn run task:totsv directory
   */
  if (taskName === '-totsv') {
    json2tsv(commandArgs);
  }
  /**
   * yarn run task:add directory  **.tsv
   */
  if (taskName === '-add') {
    addFromTsv(commandArgs);
  }
}

main();
